package ren.kane.phoenix.util.reflect;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * @author renrk(1275) on 2019-08-14 9:43 AM
 **/
public class AnnotationTest {
    public static void main(String[] args) {
        try {
            Class<?> clazz = Person5.class;
            Annotation myAnnotation = clazz.getAnnotation(MyAnnotation.class);
            System.out.println("myAnnotation=" + myAnnotation);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation {

}

@MyAnnotation
class Person5 {

}
